//
//  RemoveAccountViewModel.swift
//  KoiAccounting
//
//  Created by 纪洪文 on 22.04.25.
//

import Foundation
class RemoveAccountViewModel : KoiAccountingBaseViewModel {
 
    @Published var state = ""
    
    func removeAccount() {
        KoiAccountingNetApi.standard.remove { result in
            switch result {
            case .success:
                // 删除账号
                KoiAccountingUserManager.standard.logout()
                self.state = "success"
            case .failure(let failure):
                logger.error("remove account fail \(failure)")
            }
        }
    }
}
